#include <opencv2/opencv.hpp>

int main(int argc, const char **argv)
{

    cv::VideoCapture capture(0);
    cv::Mat edges;

    while (1)
    {
        cv::Mat frame;
        capture >> frame;   //读取当前帧

        cv::imshow("show_video", frame);    //显示当前帧

        cv::cvtColor(frame, edges, CV_BGR2GRAY);

        cv::blur(edges, edges, cv::Size(7, 7));     //模糊
        cv::Canny(edges, edges, 0, 30, 3);     //Canny算子边缘提取
        cv::imshow("show_video2", edges);    //显示当前帧

        cv::waitKey(30);    //延时30ms,控制帧率
        // if(cv::waitKey(30) >= 0) break;
    }

    return 0;
}
